#ifndef PLAYERICON_H
#define PLAYERICON_H
#include <QGraphicsItem>
#include "player.h"
#include <QRect>
#include <QPainter>

class PlayerIcon : public QGraphicsItem
{    
public:
    PlayerIcon(Player* p);
    PlayerIcon(PlayerIcon* p);
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    QRectF  boundingRect() const;
    QRectF *bounds;
    void setBountdingRect(QRectF* rect);
    Player* getPlayer();
    void placeOnFirst();
    void placeOnSecond();
    void placeOnThird();
    void placeOnHome();
    void placedOnShort();
    void placedOnLeft();
    void placedOnRight();
    void placedOnCenter();
    void placedOnCatcher();

    int getCurrentBase();
    void setCurrentBase(int base);

    //bases
    static const int homex=354;
    static const int homey=549;
    static const int firstx=516;
    static const int firsty=368;
    static const int secondx=354;
    static const int secondy=207;
    static const int thirdx=179;
    static const int thirdy= 368;

    static const int shortx=180;
    static const int shorty=468;
    static const int pitcherx=390;
    static const int pitchery=450;
    static const int catcherx=390;
    static const int catchery=600;
    static const int leftx=180;
    static const int lefty=270;
    static const int rightx=600;
    static const int righty=270;


private:
    Player* myPlayer;
    int currentBase;
};

#endif // PLAYERICON_H
